package de.vogella.android.listactivity;

import java.util.ArrayList;
import java.util.List;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class MyList extends ListActivity {

	
/** Called when the activity is first created. */

	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);		
		//Bundle extras = getIntent().getExtras();
		// Create an array of Strings, that will be put to our ListActivity
		//String[] names = new String[] { "Linux", "Windows7", "Eclipse", "Suse",
				//"Ubuntu", "Solaris", "Android", "iPhone"};
		// Create an ArrayAdapter, that will actually make the Strings above
		// appear in the ListView
		
		Grad zagreb= new Grad(10000, "Zagreb");
        Grad split= new Grad(21000, "Split");
        
        List<Grad> list = new ArrayList<Grad>();
		list.add(zagreb);
		list.add(split);
		
		ArrayAdapter<Grad> adapter = new MyAdapter(this, list);
		
		this.setListAdapter(adapter);
		//Toast.makeText(this, "Pilot: " + extras.getString("pilot"), Toast.LENGTH_LONG)
		//.show();
	}
}